package com.jsbs.iam.user.feign;

import com.jsbs.iam.common.core.dto.Result;
import com.jsbs.iam.user.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @author zhouxiangyang
 * @className ApplySystemFeign
 * @date 2022/12/15 19:16
 * @description:
 */
@FeignClient(value = "iam-auth",url = "${iam.auth.domain:127.0.0.1:83}")
public interface ApplySystemFeign {

    /**
     * 根据角色编码查询应用编码
     * @param iamUserRoleDto
     * @param
     * @return
     */
    @RequestMapping(value = "/iam/auth/roleApply/getApplyCodeList",method = RequestMethod.POST)
    Result<List<String>> getApplyCodeList (@RequestBody IamUserRoleDto iamUserRoleDto);

    /**
     * 根据用户id查询角色编码
     * @param roleUserRelationDto
     * @param uri
     * @return
     */
//    @RequestMapping(value = "/iam/auth/roleManager/getRoleCode",method = RequestMethod.POST)
//    Result<List<String>> getRoleCode (@RequestBody AuthRoleUserRelationDto roleUserRelationDto, URI uri);

    /**
     * 逻辑删除组织类型和角色,用户组的关联关系
     * @param deleteDto
     * @param
     * @return
     */
    @RequestMapping(value = "/iam/auth/userUse/deleteOrgTypeRelation",method = RequestMethod.POST)
    Result deleteOrgTypeRelation(@RequestBody OrgTypeRelationDeleteDto deleteDto);

    /**
     * 清除用户和角色,用户组的关系
     * @param deleteDto
     * @return
     */
    @RequestMapping(value ="/iam/auth/userUse/deleteUserRelation",method = RequestMethod.POST)
    Result deleteUserRelation(@RequestBody UserInfoDeleteDto deleteDto);

    /**
     * 删除应用,菜单,按钮和角色,用户组的关联关系
     * 删除应用使用
     * @param deleteDto
     * @return
     */
    @PostMapping("/iam/auth/userUse/deleteApplyRelation")
    Result deleteApplyRelation(@RequestBody ApplyConfigDeleteDto deleteDto);

    /**
     * 删除菜单,按钮和角色,用户组的关联关系
     * @param deleteDto
     * @return
     */
    @PostMapping("/iam/auth/userUse/deleteMenuRelation")
    Result deleteMenuRelation(@RequestBody MenuManagerDeleteDto deleteDto);

    /**
     * 删除按钮和角色,用户组的关联关系
     * 删除按钮使用
     *
     * @param deleteDto
     * @return
     */
    @PostMapping("/iam/auth/userUse/deleteButtonRelation")
    public Result deleteButtonRelation(@RequestBody ButtonDeleteDto deleteDto);

    /**
     * 获取应用绑定的用户
     * @param applyConfigGetDto
     * @return
     */
    @PostMapping("/iam/auth/userUse/getUserDataByApply")
    public Result getUserDataByApply(@RequestBody ApplyConfigGetDto applyConfigGetDto);
}
